public class OperationAdapter implements DataOperation {
    private QuickSort qSort;
    private BinarySearch binarySearch;

    public OperationAdapter(QuickSort qSort, BinarySearch binarySearch) {
        this.qSort = qSort;
        this.binarySearch = binarySearch;
    }

    @Override
    public void sort(int array[]) {
        qSort.quickSort(array);
    }

    @Override
    public int search(int array[], int key) {
        return binarySearch.binarySearch(array, key);
    }
}